import request from '@/utils/request'
import { ref } from 'vue'
export default () => {
	const personalschedules = ref([])
	const getPersonalschedule = async (daystr) => {
		personalschedules.value = await request.get(`mini/personalschedule?day=${daystr}`)
	}
	
	const loadPersonalschedule = async (id) => {
		personalschedule.value = await request.get(`mini/personalschedule/${id}`)
	}
	
	const personalschedule = ref({
		Personalsigns: [],
		Personalcourse: {},
		employee: {},
		appointment_amount: 0,
		current_sign_amount: 0,
		sign_amount: 0,
		start_time: "",
		end_time: "",
		color: "",
		title: "",
		employee_id: 0,
		personalcourse_id: 0,
		Personalappointments: []
	})
	return {
		getPersonalschedule,
		personalschedules,
		personalschedule,
		loadPersonalschedule
	}
}